//
//  AnnouncementViewController.m
//  YSSmartHome
//
//  Created by yanghao on 2016/10/18.
//  Copyright © 2016年 yahaong. All rights reserved.
//

#import "AnnouncementViewController.h"
#import "YHMarcros.h"
@interface AnnouncementViewController ()

@property (nonatomic, strong)UIImageView *m_imgBg;
@property (nonatomic, strong)UIScrollView *m_scrollViewPic;
@end

@implementation AnnouncementViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"小区公告";
    [self.view addSubview:self.m_scrollViewPic];
    [self.m_scrollViewPic addSubview:self.m_imgBg];
}

- (void)viewDidLayoutSubviews
{
    [super viewDidLayoutSubviews];
    CGFloat margin = 10;
    self.m_scrollViewPic.frame = CGRectMake(0, 0,kScreenWidth, kScreenHeight);
    CGFloat width =kScreenWidth-2 *margin ;
    CGFloat height = width * 1282 / 730;
    self.m_imgBg.frame = CGRectMake(margin, margin,width , height);
    self.m_scrollViewPic.contentSize = CGSizeMake(0, kScreenHeight + 20);
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


#pragma mark - lazy loading

- (UIImageView *)m_imgBg
{
    if (!_m_imgBg) {
        _m_imgBg = [[UIImageView alloc]init];
        _m_imgBg.image = [UIImage imageNamed:@"home_announcement_bg"];
    }
    return _m_imgBg;
}

- (UIScrollView *)m_scrollViewPic
{
    if (!_m_scrollViewPic) {
        _m_scrollViewPic = [[UIScrollView alloc]init];
        _m_scrollViewPic.showsVerticalScrollIndicator = NO;
        _m_scrollViewPic.showsVerticalScrollIndicator = NO;
        
    }
    return _m_scrollViewPic;
}
@end
